<?php
session_start();
if(!$_SESSION['login_status']){
	header('Location:./login.html');
	exit;
}
?>
<?php include('./include/db.class.php');?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Web VV</title>
<link type="text/css" href="./css/popup.css" rel="stylesheet" />
<style type="text/css">
*{ margin:0; padding:0;}
body{ font-family:"微软雅黑","宋体","Times New Roman", Times, serif;}
ul,li{ list-style:none;}
a{ text-decoration:none;}
.mainContent{  height:300px; position:relative; padding:0 0 0 165px;}
#sider{ position:absolute; top:0; left:0; height:300px; width:160px; background:#CCC; border:1px solid #333;}
#sider li{ cursor:pointer; height:24px; line-height:24px; border-bottom:1px dashed #666;}
#sider li em{ color:#F60; font-size:11px;}
</style>
<script type="text/javascript" src="http://wx.xunlei.com/js/jq1.2.js"></script>
<script type="text/javascript" src="./js/plugin.js"></script>
<script type="text/javascript" src="./js/comet.js"></script>
</head>
<?php
$me = $_SESSION['login_id'];
$sql = 'select * from vv_members where vv_id != '.$me.' limit 10';
$DB->query($sql);
$array = $DB->get_rows_array();
?>
<body>
<h1 id="infoBar">
	欢迎你!
	<strong name="<?php echo $me ?>"><?php echo $_SESSION['login_status'] ?></strong>
</h1>
<a id="reConnectBt" href="#">重新连接</a>
<a id="closeConnectBt" href="#">断开连接</a>
<div class="mainContent">
	<div id="sider">
		<ul id="userList">
			<?php foreach($array as $i){ ?>
			<li name="<?php echo $i['vv_id'] ?>"><?php echo $i['vv_name'] ?><em></em></li>
			<?php } ?>
		</ul>
	</div>
</div>
<!--<iframe src="test.html"></iframe>-->
<div id="tempBox" style="display:none;"></div>

<script type="text/javascript">
(function(){
	/*var from = $('#infoBar strong').attr('name');
	var msg = $('#textarea').val();
	var to = $('#to').val();*/
	$('#reConnectBt').click(function(){
		comet.onUnload();
		comet.init($('#infoBar strong').attr('name'));
		return false;
	});
	$('#closeConnectBt').click(function(){
		comet.onUnload();
		return false;
	});
	$('#sider li').popupWin();
})();
window.onload = function(){ comet.init($('#infoBar strong').attr('name'))};
window.onunload = comet.onUnload;
</script>

</body>
</html>